# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-backports-os
_pkgname=backports.os
pkgver=0.1.1
pkgrel=3
pkgdesc="Backport of new features in Python's os module."
url='https://pypi.org/project/backports-os/#files'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('310887a6d18d63cd0b165442aa300a88208533efdf8b45cd9fb973d139b23fc9a2dae9de36bb84975c166b30a73184f5e63564c7a48683502b2fc093c6a6f865')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  rm -f \
    "$pkgdir/usr/lib/python2.7/site-packages/backports/__init__."{py,pyc,pyo}
}

